package net.zoneland.knowledge.dao;

import net.zoneland.knowledge.model.OrgLeader;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 党组织管理员dao
 */
@Mapper
public interface OrgLeaderMapper {

    /**
     * 根据党组织编号获取部门管理员编号和名称
     * @param orgUuid
     * @return
     */
    @Select({"select user_id,user_name from AITK_ORG_LEADER where org_uuid=#{orgUuid, jdbcType=VARCHAR}"})
    @Results({
            @Result(column = "user_id", property = "userId", jdbcType = JdbcType.VARCHAR),
            @Result(column = "user_name", property = "userName", jdbcType = JdbcType.VARCHAR),
    })
    List<OrgLeader> getLeaderByOrg(String orgUuid);
}
